<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
 		flag = true;
  $(window).scroll(function(){
  	 var wHeight = $(window).height();
  	 var dHeight = $(document).height();
  	 var tHeight = $(document).scrollTop(); 
  	 if(wHeight + tHeight >= dHeight - 100 && flag){
  	 	flag = false;

  	 	$.ajax({
			  url: "http://www.baidu.com",
			  success: function(data){
			    $("#news").append(data);
	  	 		$("#news").append(wHeight+" "+dHeight+" "+tHeight);
	  	 		flag = true;
			  }
			});
		 }
  	});
  });
  
  function shit(){
  	$.get("baidu.html",{name:111},function(htmldata){
  		$("#news").append("data"+htmldata);
  		});
  	}
</script>
</head>
<body>
	<input type="button" onclick="shit()" value="shit" />
  <div style="min-height:1000px" id="news">
  	<p>wwwwwwwwwwwwwwwwwww<span> red = red;</span></p>
  	<p>wwwwwwwwwwwwwwwwwww<span> red = red;</span></p>
  	<p>wwwwwwwwwwwwwwwwwww<span> red = red;</span></p>
  	<p>wwwwwwwwwwwwwwwwwww<span> red = red;</span></p>
  	<p>wwwwwwwwwwwwwwwwwww<span> red = red;</span></p>
  	<p>wwwwwwwwwwwwwwwwwww<span> red = red;</span></p>
  	<p>wwwwwwwwwwwwwwwwwww<span> red = red;</span></p></div>
  		
</body>
</html>